Page({
  pay() {//支付函数
    wx.login({
      success: res => {
        wx.request({
          url: app.configurl + 'Pay/pay_wx',
          data: {
            code: res.code,
            total_fee: Number(that.data.baihuocart.prices) * 100,
          },
          method: 'POST',
          success: function (res) { //获取订单号，+5 个参数
            wx.requestPayment({
              timeStamp: res.data.timeStamp,
              nonceStr: res.data.nonceStr,
              package: res.data.package,
              signType: res.data.signType,
              paySign: res.data.paySign,
              success: function (res) {},//支付成功
              fail: function (res) {}//支付失败
            })
          }
        });
      }
    });
  }
})